<template>
	<view class="wrap">
		<view class="title">{{msgInfo.noticeTitle}}</view>
		<view class="date">{{msgInfo.createTime}}</view>
		<view class="content">
			<u-parse :html="msgInfo.noticeContent"></u-parse>
			<!-- <u-parse v-if="msgInfo.type == 0" :html="msgInfo.alertHtml"></u-parse> -->
			<!-- <u-parse v-if="msgInfo.type == 1" :html="msgInfo.alert"></u-parse> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msgInfo: null
			}
		},
		onLoad(options) {
			// this.getAlertMsgById(options.id)
			if(options.msgInfo) {
				this.msgInfo = JSON.parse(options.msgInfo)
			}
		},
		methods: {
			getAlertMsgById(id) {
				this.$g_util.request({
					url: `/alert/getAlertInfo?id=${id}`,
					header: true
				}).then(({
					data
				}) => {
					uni.$emit('update-updateMsgList')
					this.msgInfo = data
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.wrap {
		min-height: 100vh;
		padding: 46rpx 28rpx 50rpx 32rpx;
		box-sizing: border-box;
		background-color: #fff;
	}

	.title {
		font-size: 36rpx;
		font-weight: bold;
		color: #333333;
	}

	.date {
		margin: 20rpx 0 30rpx;
		font-size: 26rpx;
		color: #999999;
	}

	.content {
		// text-align: justify;
		// text-align-last: justify;
		font-size: 30rpx;
		line-height: 48rpx;
	}
</style>
